package com.umeng.soexample.mvc.view;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.TextView;

import com.umeng.soexample.R;
import com.umeng.soexample.tbarea.area.BottomDialog;
//import com.umeng.soexample.tbarea.databinding.ActivityMainBinding;

public class AddresActivity extends AppCompatActivity {
    private ViewDataBinding mBinding;
    private Button btn;
    private TextView tv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_addres);
        mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_addres, null, false);
        setContentView(mBinding.getRoot());
        btn=findViewById(R.id.btn);
        tv=findViewById(R.id.tv);
        initView();
    }

    private void initView() {
        BottomDialog dialog = new BottomDialog(this);
        dialog.setResultCallBack(result -> tv.setText(String.format("地区：%s", result)));
        btn.setOnClickListener(v -> dialog.show());
    }

}
